package com.openharmony.filepicker.filetype;


import com.openharmony.filepicker.ResourceTable;

public class DataFileType extends FileType {

    public DataFileType() {
        this.setFileType("DataFile");
        this.setFileIconResId(ResourceTable.Media_ic_unknown_file_picker);
    }

    @Override
    public boolean verify(String fileName) {
        boolean isHasSuffix = fileName.contains(".");
        if (!isHasSuffix) {
            return false;
        }
        String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);

        switch (suffix) {
            case "csv":
            case "dat":
            case "ged":
            case "key":
            case "keychain":
            case "pps":
            case "ppt":
            case "pptx":
            case "sdf":
            case "tar":
            case "tax2016":
            case "tax2017":
            case "vcf":
            case "xml":
                return true;
            default:
                return false;
        }
    }
}
